<?php

$filename = "../../../../uploads/message/$_POST[name]";
//echo $filename;
    if (($handle = fopen($filename, "r")) !== FALSE) {
    $list = array();
    while (($row = fgetcsv($handle, 1000, ",")) !== FALSE) {
        $list[$row[2]][] = $row[0].'_'.$row[1];
    }
    fclose($handle);
    }
    array_shift($list);
    
    unlink($filename);
    
    echo json_encode($list);
    //echo 0; // file csv khong ton tai

